package com.sxj.corejava.code07_面向对象.租车系统;

/**
 * @author 石小俊
 * @date 2024年03月21日 20:02
 */
public class Bus extends MotorVehicle {

    private int seatCount;  // 座位数

    public Bus(String no, String brand, int seatCount) {
        super(no, brand);
        this.seatCount = seatCount;
    }

    public int getSeatCount() {
        return seatCount;
    }

    public void setSeatCount(int seatCount) {
        this.seatCount = seatCount;
    }

    @Override
    public double rent(int day) {
        double sum = 0;
        if (seatCount <= 30) {
            sum = 1000 * day;
        } else {
            sum = 2000 * day;
        }
        return sum;
    }
}
